package com.wengu.algorithm.controller;


import com.wengu.algorithm.service.TaskAssignmentScenarioService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * <p>
 * 任务分配场景主表 前端控制器
 * </p>
 *
 * @author wanghailei
 * @since 2025-02-09
 */
@Slf4j
@RestController
@RequestMapping("/taskAssignmentScenario")
public class TaskAssignmentScenarioController {

    @Resource
    private TaskAssignmentScenarioService taskAssignmentScenarioService;


    @GetMapping("/generateAllDataV1")
    public String generateAllDataV1(){
        return taskAssignmentScenarioService.generateAllDataV1();

    }

    @GetMapping("/executeGreedyAlgorithmQEA")
    public void executeGreedyAlgorithmQEA(@RequestParam("versionNo") Integer versionNo, @RequestParam("alpha")Double alpha) {
        taskAssignmentScenarioService.executeGreedyAlgorithmQEA(versionNo, alpha);
    }

    @GetMapping("/executeGreedyAlgorithmQAOTO")
    public void executeGreedyAlgorithmQAOTO(@RequestParam("versionNo") Integer versionNo) {
        taskAssignmentScenarioService.executeGreedyAlgorithmQAOTO(versionNo);
    }

    @GetMapping("/executeGreedyAlgorithmGenetic")
    public void executeGreedyAlgorithmGenetic(@RequestParam("versionNo") Integer versionNo){
        taskAssignmentScenarioService.executeGreedyAlgorithmGenetic(versionNo);
    }

    @GetMapping("/executeGreedyAlgorithmQEABatchAlpha")
    public void executeGreedyAlgorithmQEABatchAlpha(@RequestParam("versionNo") Integer versionNo){
        taskAssignmentScenarioService.executeGreedyAlgorithmQEABatchAlpha(versionNo);
    }

    @GetMapping("/executeGreedyAlgorithmBQEA")
    public void executeGreedyAlgorithmBQEA(@RequestParam("versionNo") Integer versionNo, @RequestParam("heuristicWeight")Double heuristicWeight
            ,@RequestParam("bestSelectionProbability") Double bestSelectionProbability){
        taskAssignmentScenarioService.executeGreedyAlgorithmBQEA(versionNo, heuristicWeight,bestSelectionProbability);
    }

    @GetMapping("/executeGreedyAlgorithmBQEABatch")
    public void executeGreedyAlgorithmBQEABatch(@RequestParam("versionNo") Integer versionNo){
        taskAssignmentScenarioService.executeGreedyAlgorithmBQEABatch(versionNo);
    }

    @GetMapping("/executeGreedyAlgorithmETDA")
    public void executeGreedyAlgorithmETDA(@RequestParam("versionNo") Integer versionNo, @RequestParam("alpha")Double alpha, @RequestParam("gamma")Double gamma){
        taskAssignmentScenarioService.executeGreedyAlgorithmETDA(versionNo,alpha, gamma);

    }
    @GetMapping("/executeGreedyAlgorithmETDABatchBeta")
    public void executeGreedyAlgorithmETDABatchBeta(@RequestParam("versionNo") Integer versionNo){
        taskAssignmentScenarioService.executeGreedyAlgorithmETDABatchBeta(versionNo);

    }


    @GetMapping("/executeGreedyAlgorithmEDBA")
    public void executeGreedyAlgorithmEDBA(@RequestParam("versionNo") Integer versionNo, @RequestParam("alpha")Double alpha
            , @RequestParam("gamma")Double gamma, @RequestParam("mu")Double mu){
        taskAssignmentScenarioService.executeGreedyAlgorithmEDBA(versionNo,alpha, gamma,mu);

    }

    @GetMapping("/executeGreedyAlgorithmEDBABatch")
    public void executeGreedyAlgorithmEDBA(@RequestParam("versionNo") Integer versionNo){
        taskAssignmentScenarioService.executeGreedyAlgorithmEDBABatch(versionNo);

    }

    @GetMapping("/executeGreedyAlgorithmBETDA")
    public void executeGreedyAlgorithmBETDA(@RequestParam("versionNo") Integer versionNo, @RequestParam("alpha")Double alpha, @RequestParam("gamma")Double gamma){
        taskAssignmentScenarioService.executeGreedyAlgorithmBETDA(versionNo,alpha, gamma);
    }


    @GetMapping("/executeGreedyAlgorithmBatchBETDA")
    public void executeGreedyAlgorithmBatchBETDA(@RequestParam("versionNo") Integer versionNo){
        taskAssignmentScenarioService.executeGreedyAlgorithmBatchBETDA(versionNo);
    }


    @GetMapping("/executeGreedyAlgorithmQPA")
    public void executeGreedyAlgorithmQPA(@RequestParam("versionNo") Integer versionNo){
        taskAssignmentScenarioService.executeGreedyAlgorithmQPA(versionNo);
    }

    @GetMapping("/executeGreedyAlgorithmTDA")
    public void executeGreedyAlgorithmTDA(@RequestParam("versionNo") Integer versionNo){
        taskAssignmentScenarioService.executeGreedyAlgorithmTDA(versionNo);
    }

    @GetMapping("/executeGreedyAlgorithmPACO")
    public void executeGreedyAlgorithmPACO(@RequestParam("versionNo") Integer versionNo){
        taskAssignmentScenarioService.executeGreedyAlgorithmPACO(versionNo);
    }



    @GetMapping("/executeAlgorithmAll")
    public void executeAlgorithmAll(@RequestParam("versionNo") Integer versionNo){
        taskAssignmentScenarioService.executeAlgorithmAll(versionNo);
    }

}
